package com.itlong.cloud.POJO.DTO.property;

import com.itlong.cloud.enumerate.AppUserRoomHouserTypeEnum;
import com.itlong.cloud.enumerate.AppUserRoomOfficeHouserTypeEnum;
import com.itlong.cloud.enumerate.AppUserRoomSourceEnum;
import com.itlong.cloud.enumerate.AppUserRoomStatusEnum;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang.StringUtils;

import java.io.Serializable;

/**
 * <desc>
 *      App用户详情页相关房屋数据传输对象
 * </desc>
 *
 * @createDate 2017-09-22
 */
@Data
@NoArgsConstructor
//@EqualsAndHashCode(callSuper = true)
public class AppUserRoomDetailsDTO implements Serializable{
    private String phoneNum;    //用户手机号
    private String roomId;      //房间Id
    private String roomNum;         //房间号
    private String roomName;            //房间名称
    private String roomType;        // 房间类型 1住宅 3办公
    private String qqNum;           //QQ号
    private String projectName;     //项目名称
    private String projectId;       //项目Id
    private String buildName;       //楼栋名称
    private String buildId;         //楼栋Id
    private String unitName;        //单元名称
    private String unitId;          //单元Id
    private String type;    //房屋类型
    private String houserType;      ////住户身份：1业主本人 2亲属 3租客
    private String houserTypeName;  //住户身份名称
    private Integer source;     //用户来源:1邀请 2注册 3管理员添加 4一卡通(AppUserInfoPO)
    private String sourceName;  //用户来源名称
    private Integer userRoomStatus;     //用户房间状态：1待审核 2迁入 3迁出 4未通过(AppUserRoomPO)
    private String userRoomStatusName;  //用户房间状态名称
    private String createTime;            //创建时间(AppUserRoomPO)
    private String updateTime;            //更新时间

//    public String getHouserTypeName() {
//        if (StringUtils.isNotBlank(houserType)) {
//            if(roomType.equals("1")) {
//                return AppUserRoomHouserTypeEnum.getDescription(Integer.parseInt(houserType));
//            }else{
//                return AppUserRoomOfficeHouserTypeEnum.getDescription(Integer.parseInt(houserType));
//            }
//        } else {
//            return houserTypeName;
//        }
//    }

    public String getSourceName() {
        if(source != null) {
            return AppUserRoomSourceEnum.getDescription(source);
        } else {
            return sourceName;
        }
    }

    public String getUserRoomStatusName() {
        if(userRoomStatus != null) {
            return AppUserRoomStatusEnum.getDescription(userRoomStatus);
        } else {
            return String.valueOf(userRoomStatus);
        }
    }
}
